<template>
  <div class="bargitem_container">
      <!-- 砍价跳转 -->
      <div class="bargaining_wrapper" @click="goBargaining">
        砍价列表
      </div>
      <!-- 砍价主页商品 右图左文字 -->
      <div class="bargitem_wrapper" 
           @click="goBargaining"
           v-for="(item,index) in BargList" 
           :key="index"
           v-show="item.id > 99761">
          <!-- 图片 -->
        <div class="bargitem_item_img">
              <img :src="item.pic">
        </div>
          <!-- 文字单价部分 -->
        <div class="bargitem_item_right">
            <div class="bargitem_item_right_top">
                <span style="fontSize:0.7rem;margin-bottom:5px">{{item.name}}</span>
                <span style="fontSize:0.5rem;color:#ddd">{{item.characteristic}}</span>
            </div>
            <div class="bargitem_item_right_bottom">
                <div class="bargitem_item_right_bottom_left bargitem_item_right_bottom_item">
                    <span style="color:red;margin-bottom:5px">￥{{item.minPrice}}</span>
                    <span>低价</span>
                </div>
                <div class="bargitem_item_right_bottom_center bargitem_item_right_bottom_item">
                    <span style="color:#ddd">￥{{item.originalPrice}}</span>
                    <span style="color:#ddd">原价</span>
                </div>
                <div class="bargitem_item_right_bottom_right bargitem_item_right_bottom_item">
                    <span style="color:#ddd">{{item.stores}}</span>
                    <span style="color:#ddd">限量</span>
                </div>
            </div>
        </div>
      </div>
  </div>
</template>

<script>
import PATH from "../../router/constant"
export default {
    mixins:[PATH],
    data() {
        return {
            BargList : []
        }
    },
    mounted(){
       this.$CLIENT.getBarg().then(res=>{
            // console.log(res.data.data.goodsMap)
            this.BargList = res.data.data.goodsMap
       }).catch((error)=>{
            console.log(error)
       })
    },
    methods:{
        // 跳转砍价列表
       goBargaining(){
        this.$router.goNext(PATH.BARGAINING)
       }
    }
}
</script>

<style scoped>
.bargaining_container 
{
    width: 100%;
    height: 2.7rem;
    background-color: #fff;
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bargaining_wrapper
{
   width: 100%;
    height: 45px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    background-color: #fff;
    color: #666;
}

.bargaining_container 
{
    width: 100%;
    height: 2.7rem;
    background-color: #fff;
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.bargitem_container
{
    width: 100%;
    background-color: #fff;
    box-sizing: border-box;
    /* margin-bottom: 60px; */
    border-bottom: 0.5rem solid #eee;
    margin-top: 38px ;
}

.bargitem_wrapper
{
    width: 100%;
    height: 100%;
    display: inline-flex;
    justify-content: space-between;
    padding: 5px;
    /* margin-bottom: 60px; */
    box-sizing: border-box;
    border-top: 1px solid #eee;
}

.bargitem_item_img
{
    width: 40%;
    height: 100%;
}

.bargitem_item_img img 
{
    width: 100%;
    /* height: 100%; */
    border-radius: 5px;
}

/* 图片右侧内容样式 */
.bargitem_item_right
{
    width: 100%;
    height: 133px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.bargitem_item_right_top
{
    width: 90%;
    height: 30%;
    /* background-color: red; */
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
}

.bargitem_item_right_bottom
{
    width: 90%;
    height: 40%;
    /* background-color: #000; */
    margin-top: 1rem;
    display: inline-flex;
    justify-content: space-around;
}

.bargitem_item_right_bottom_item
{
    width: 25%;
    height: 100%;
    /* background-color: green; */
    font-size:0.7rem;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}
</style>